    package com.heima.tuozhan.day06.timu1;

    public class Student {
        private String name;
        private String sex;
        private int age;

        public Student() {
        }

        public Student(String name, String sex, int age) {
            this.name = name;
            this.sex = sex;
            this.age = age;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getSex() {
            return sex;
        }

        public void setSex(String sex) {
            if(getSex() == "男"&& getSex() == "女" ){
                this.sex = sex;
            }else {
                throw new SexExcepion();
            }
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            if(getAge()>=15&&getAge()<=50) {
                this.age = age;
            }else {
                throw new AgeException();
            }
        }
    }
